import { baseUrlApi, requestClient, type Result } from '#/api/request';




/** 表单列表 */
export const getEmailTemplate = (params?: object) => {
  return requestClient.get<Result>(baseUrlApi('/portal/admin/email_template'),{params});
};


/**
 * 添加表单
 * @param data
 * @returns
 */
export const postEmailTemplat = (data?: object) => {
    return requestClient.post<Result>(baseUrlApi('/portal/admin/email_template'), data);
  };
  
  /**
   * 获取表单信息
   * @param id
   * @returns
   */
  // export const getEmailTemplatInfo = (id: number) => {
  //   return requestClient.get<Result>(baseUrlApi(`/portal/admin/email_template/${id}`));
  // };
  export const getEmailTemplatInfo = (data?: object) => {
    return requestClient.post<Result>(baseUrlApi('/portal/admin/email_template_get'), data);
  };
  /**
   * 编辑表单
   * @param id
   * @param data
   * @returns
   */
  export const putEmailTemplat = (data?: any) => {
    return requestClient.put<Result>(
      baseUrlApi(`/portal/admin/email_template/${data.id}`),
      data,
    );
  };
  
  /**
   * 删除表单
   * @param id
   * @returns
   */
  export const deleteEmailTemplat = (id: number) => {
    return requestClient.delete<Result>(baseUrlApi(`/portal/admin/email_template/${id}`));
  };
  
